import { ApiCall } from "tsrpc";
import { ReqLook, ResLook } from "../../../../shared/master/body/equip/PtlLook";
import { player } from "../../../../model/fight/body/player";
import { template } from "../../../../shared/master/MsgAction";
import manage_EquipStrengthen from "../../../model/manage/manage_EquipStrengthen";

export default async function (call: ApiCall<ReqLook, ResLook>) {
    call.succ({})
    let user = call.req._player as player;
    let item =  user.equip_ordinary[call.req.idx - 1];
    if(!item){
        user.sendMsg(template.default,`装备栏没有ID为${call.req.idx}的装备`)
        return;
    }
    manage_EquipStrengthen.update(user.uuid, item)
    user.sendMsg(template.panel_equip, item.get_panel())
}